package com.shujia.day09;


abstract class Demo2{
    public abstract void fun1();
}

//class Demo2Zi extends Demo2{
//    @Override
//    public void fun1() {
//        System.out.println("好好学习，天天向上！");
//    }
//}


class Student2{
    public void show1(Demo2 demo2){ //Demo2 demo2 = new Demo2Zi()
        demo2.fun1();
    }
}

public class NiMingClassDemo2 {
    public static void main(String[] args) {
        Student2 student2 = new Student2();
//        student2.show1(new Demo2Zi());
        student2.show1(new Demo2() {
            @Override
            public void fun1() {
                System.out.println("好好学习，天天向上！");
            }
        });
    }
}
